package com.yhc.my.an_meishia.activities;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;

import com.yhc.my.an_meishia.R;

public class VideoShowActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_show);
        VideoView vvS = (VideoView) findViewById(R.id.vv_shoucang);
        TextView tvCap = (TextView) findViewById(R.id.tv_caption);
        Intent intent = getIntent();
        String url = intent.getStringExtra("url");
        String caption = intent.getStringExtra("caption");
        tvCap.setText(caption);
        vvS.setVideoURI(Uri.parse(url));
        vvS.start();
        MediaController controller = new MediaController(VideoShowActivity.this);
        vvS.setMediaController(controller);
    }
}
